package farmer.game;

import java.awt.Color;
import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.image.BufferedImage;

import core.game.StateBasedGame;
import core.state.BasicState;
import farmer.gui.InGameMenuGUI;

public class InGameMenuState extends BasicState{
	
	public static BufferedImage image;
	
	private InGameMenuGUI gui;

	public InGameMenuState(StateBasedGame game, int stateID) {
		super(game, stateID);
		gui = new InGameMenuGUI(this);
	}
	
	public void keyPressed(KeyEvent e){
		if(e.getKeyCode() == KeyEvent.VK_R || e.getKeyCode() == KeyEvent.VK_ESCAPE){
			getGame().enterState(FarmerBoyGame.MainGame);
		}else if(e.getKeyCode() == KeyEvent.VK_N){
			Data.status = Data.failed;
			getGame().enterState(FarmerBoyGame.MainGame);
		}else if(e.getKeyCode() == KeyEvent.VK_Q){
			Data.status = Data.failed;
			getGame().enterState(FarmerBoyGame.MainMenu);
		}
	}

	@Override
	public void enter() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void init() {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void render(Graphics2D g) {
		g.drawImage(image, 0, 0, null);
		g.setColor(new Color(0, 0, 0, 0.6f));
		g.fillRect(0, 0, 800, 600);
		gui.render(g);
	}

	@Override
	public void update(int deltaTime) {
		// TODO Auto-generated method stub
		
	}

}
